<div class="SipeiMain_r fr">
    <h2 class="clearfix fonts_18 height45 fontc_444">通知</h2>
    <div class="clearfix back_bgf border_3 border_c fontc_666 SipeiNotice height20">
        <div class="clearfix pt20 pb20">
            <div class="fl DetailLeft pr30 m_so_r">
                <h3 class="clearfix fonts_16 fontc_444 pb10"><?php echo $info['notice_name']; ?></h3>
                <p class="clearfix"><img src="/themes/default/images/Sipei/time.png" class="fl pt2 pr3" /><font class="fl fontc_bbb"><?php echo date('Y年m月d日 H:i:s', $info['time_created']); ?></font></p>
                <p class="clearfix"><img src="/themes/default/images/Sipei/Person.png" class="fl pt2 pr3" /><font class="fl fontc_bbb"><?php echo $info['username']; ?></font></p>
                <?php echo $info['notice_comment']; ?>
            </div>
            <div class="fl DetailRight pl30">
                <h4 class="clearfix fonts_16 fontc_444 pb10">附件：</h4>
                <?php if (!empty($info['file'])): ?>
                    <?php $file = explode('||', $info['file']); ?>

                    <?php
                    if (!empty($info['file_name'])) {
                        $file_name = explode('||', $info['file_name']);
                    }
                    foreach ($file as $key => $value): ?>

                        <ul class="clearfix fontc_bbb">
                            <li class="clearfix pb5"><?php echo (!empty($file_name[$key])) ? $file_name[$key] : basename($value); ?></li>
                            <li class="clearfix">

                                <input type="button" onclick="upload(<?php echo $key + 1; ?>)" value="下载" class="fl b_a_n border_3 w80 height32 fontc_FFF fonts_12 DetailButton text_indent" />
                            </li>
                        </ul>
                    <?php endforeach; ?>
                <?php endif; ?>
            </div>
        </div>
    </div>      
</div>


<script>
    
    function upload(num) {
        var notice_id = '<?php echo $info['notice_id']; ?>';
        $.get('/notice/default/download', {notice_id:notice_id,num:num}, function(data) {
            if(data==1){
                $.dialog.alert('通知id不存在');
            }else if(data==2){
                $.dialog.alert('通知文件不存在');
            }else{
                window.location.href = '<?php echo $this->createUrl('/notice/default/download'); ?>/notice_id/'+notice_id+'/num/'+num;
            }
            return false;
        });
    }
    
</script>

